<%--
    Document   : ContinueResult
    Created on : Oct 26, 2009, 1:36:54 PM
    Author     : Administrator
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib uri="http://ajaxtags.org/tags/ajax" prefix="ajax" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="java.sql.*" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <jsp:include page="header.jsp" />

        <link rel="stylesheet" href="css/style1.css" />
        <link rel="stylesheet"
              href="css/styles.css"
              type="text/css"/>
        <title>JSP Page</title>
    </head>
    <body>
        <jsp:useBean id="ObjectTest" scope="request" class="DAO.Result" />
        <%
            int id = Integer.parseInt(request.getParameter("resultID"));
            int idQuestionResult;
            int i = 1;
            String ConntentQuestion;
            ResultSet rt = ObjectTest.selectQuestion(id);
            while (rt.next()) {
                idQuestionResult = rt.getInt("QuestionID");
                ResultSet rt1 = ObjectTest.selectQuestionContent(idQuestionResult);
                while (rt1.next()) {

        %>
        <P style="font-size:18px"><%=i%> .<%=rt1.getString("ContentQuestion")%></P>
        <%
                    int idQuestion = rt1.getInt("QuestionID");
                    ResultSet rt2 = ObjectTest.selectAnswerAdmin(idQuestion);
                    while (rt2.next()) {
                        int checkAnswerUser = rt2.getInt("AnswerID");
                        ResultSet rt3 = ObjectTest.SelectAnswerUser(id);
                        while (rt3.next()) {
                            int checkAnwerAdmin = rt2.getInt("AnswerID");
                            if (checkAnswerUser == checkAnwerAdmin) {
        %>
        <input type="checkbox" checked="checked" name="Choice" value="<%=rt2.getString("AnswerID")%>"/><%=rt2.getString("AnswerContent")%> <br>
        <%
                            } else {
        %>
        <input type="checkbox" checked="checked" name="Choice" value="<%=rt2.getString("AnswerID")%>"/><%=rt2.getString("AnswerContent")%> <br>
        <%
                            }
                        }
                    }
        %>
        <div align="left">

            <dir id="result" ></div>
    </div>
    <%
                }
                i++;

            }%>
</body>

</html>
